#include <stdio.h>
#include <stdbool.h>
#include <mrubyc.h>
<%- picogems.each do |_require_name, v| -%>
<%- if File.exist?(v[:mrbfile]) -%>
#include "<%= v[:mrbfile] %>"
<%- end -%>
<%- end -%>

typedef struct picogems {
  const char *name;
  const uint8_t *mrb;
  void (*initializer)(mrbc_vm *vm);
  bool required;
} picogems;

picogems prebuilt_gems[] = {
<%- picogems.each do |require_name, v| -%>
<%- if File.exist?(v[:mrbfile]) -%>
  {"<%= require_name %>", picogem_<%= File.basename(v[:mrbfile], ".c").gsub('-','_') %>, <%= v[:initializer] %>, false},
<%- end -%>
<%- end -%>
  {NULL, NULL, NULL, true} /* sentinel */
};


